package com.dhee.creditcardsystem.service.Impl;

import com.dhee.creditcardsystem.dao.UsersDao;
import com.dhee.creditcardsystem.model.Users;
import com.dhee.creditcardsystem.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class UsersServiceImpl implements UsersService {
    @Autowired
    private UsersDao usersDao;

    @Override
    public Users login(Users users) {
        Users u = usersDao.selectByLoginn(users.getLoginn());
        if (u != null && u.getPass().equals(users.getPass()) ) {
            return u;
        } else {
            return u = null;
        }
    }




    @Override
    public int addUsers(Users users) {
        return usersDao.addUsers(users);
    }
}
